//
//  BaseViewController.m
//  LimitFree
//
//  Created by LZXuan on 15-6-8.
//  Copyright (c) 2015年 轩哥. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithRed:226/255.0 green:226/255.0 blue:226/255.0 alpha:1];
}
//标题视图
- (void)addTitleViewWithTitle:(NSString *)title {
    UILabel *titleLabel = [MyControl creatLabelWithFrame:CGRectMake(0, 0, 200, 30) text:title];
    //字体颜色和名字都是美工 提供
    titleLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:22];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.textColor = [UIColor colorWithRed:30/255.0f green:160/255.0f blue:230/255.0f alpha:1];
    
    self.navigationItem.titleView = titleLabel;
}
//导航左右按钮
- (void)addItemWithTitle:(NSString *)title
                  target:(id)target
                  action:(SEL)action
                  isLeft:(BOOL)isLeft {
    UIButton *button = [MyControl creatButtonWithFrame:CGRectMake(0, 0, 50, 30) target:target sel:action tag:100 image:@"buttonbar_action" title:title];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:button];
    if (isLeft) {
        self.navigationItem.leftBarButtonItem = item;
    }else{
        self.navigationItem.rightBarButtonItem = item;
    }
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
